package com.chenyongjing.design.pattern.singleton.hungrySingleton;

/**
 * 先静态后动态
 * 先上后下
 * 先属性后方法啊
 */
public class HungryStaticSingleton {
    private static final HungryStaticSingleton hungryStaticSingleton;
    // 实例化对象，代码块
    static {
        hungryStaticSingleton = new HungryStaticSingleton();
    }

    /**
     * 私有化构造方法
     */
    private HungryStaticSingleton(){}

    public static HungryStaticSingleton getInstance() {
        return hungryStaticSingleton;
    }
}
